<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class Announcements extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('announcements', function (Blueprint $table) {
             $table->engine = 'InnoDB';
             $table->charset = 'utf8mb4';
             $table->collation = 'utf8mb4_unicode_ci';
            // CONTENT
            $table->increments('id')->nullable(false)->comment('');
			$table->unsignedInteger('company_id')->nullable(false)->comment('项目编号');
			$table->unsignedInteger('site_id')->nullable(false)->comment('站点编号');
			$table->string('title', 255)->nullable(false)->comment('公告标题');
			$table->text('content')->nullable(false)->comment('公告内容');
			$table->integer('poster_id')->nullable(false)->comment('发布者编号');
			$table->string('poster_name', 255)->nullable(false)->comment('发布者姓名');
			$table->boolean('status')->nullable(false)->default(0)->comment('状态, 0=未发布， 1=已发布');
			$table->timestamp('created_at')->nullable()->comment('');
			$table->timestamp('updated_at')->nullable()->comment('');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('announcements');
    }
}
